package com.googlecode.imanager.client;

import com.googlecode.imanager.client.bridge.IPicture;
import com.googlecode.imanager.client.media.Image;
import com.googlecode.imanager.client.util.Utils;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class Picture extends Control implements IPicture {

    private static final long serialVersionUID = 1L;

    private Image image;

    public Picture() {
    }

    public Picture(Container parent) {
        this();
        setParent(parent);
    }
    
    public Image getImage() {
        return image;
    }

    public void setImage(Image image) {
        if (!Utils.isEquals(this.image, image)){
            this.image = image;
            getBridge().setImage(image);
        }
    }
    
    @Override
    protected IPicture getBridge() {
        return (IPicture) lookupBridge();
    }
    
    @Override
    public Picture clone() {
        return (Picture) super.clone();
    }    

}
